﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RenAi.Medical.BLL;
using RenAi.Medical.Model;
using System.Data;

namespace RenAi.Medical.Admin
{
    public partial class Par_Update : System.Web.UI.Page
    {
        //实例化对象
        ParticularBLL bll = new ParticularBLL();

        public void GetParticuar()
        {
            this.txtid.Text = Request.QueryString["Particular_Id"].ToString();
            DataTable dt = bll.GeParticular(this.txtid.Text);
            //保存并显示控件
            this.txtname.Text = dt.Rows[0][1].ToString();
            this.txtF_Id.Text = dt.Rows[0][2].ToString();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetParticuar();            
            }
        }
        protected void btnupt_Click1(object sender, EventArgs e)
        {
            //实例化对象
            Particular p = new Particular();
            p.Particular_Id  = int.Parse(this.txtid.Text);
           p.Particular_Name = this.txtname.Text;
           p.FingerpostType_Id  = int.Parse(this.txtid.Text);
            //判断
            if (bll.UpdateParticular(p) > 0)
            {
                Response.Write("<script>alert('修改成功！');</script>");
                Response.Redirect("jiuyizhinan.aspx");
                GetParticuar(); //刷新数据
            }
        }

        protected void btnback_Click(object sender, EventArgs e)
        {
            //返回
            Response.Redirect("jiuyizhinan.aspx");
        }
    }
}